﻿using RaSuperGrid.SuperGrid.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media;

namespace RaSuperGrid.SuperGrid.Converter
{
    class UrgencyValueConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            int urgency = System.Convert.ToInt32(value);
            if (IsNow(urgency))
            {
                return Brushes.Red as Brush;
            }
            else
            {
                return Brushes.Black as Brush;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        public static bool IsNow(int urgency)
        {
            return (urgency == (int)UrgencyType.Now);
        }
    }
}
